package raft.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import raft.service.Node;

import java.io.Serializable;
import java.lang.reflect.Method;
@ToString
@Getter
@Setter
public class ClientKVReq implements Serializable {

    public static int PUT = 0;
    public static int GET = 1;

    int type;

    String key;

    String value;

    public enum Type{
       PUT(0),GET(1);
       int code;
       Type(int code){
           this.code = code;
       }

       public static Type value(int code){
           for (Type type:values()){
               if(type.code==code){
                   return type;
               }
           }
           return null;
       }




    }



    public ClientKVReq(String key,String value,int type){
        this.key = key;
        this.value = value;
        this.type = type;

    }

    public static void main(String[] args) {
        System.out.println(Type.value(1));
    }


}
